Skip to main content
Glama
ZephyrDeng

mcp-server-gitlab

Gitlab Search Project Details Tool

Search for GitLab project details by project name and filter response fields to improve efficiency. Streamline project data retrieval for better team collaboration.

Instructions

根据项目名称搜索项目及其详细信息,支持字段过滤,提升响应效率。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNo需要返回的字段路径数组,支持数组或逗号分隔字符串,用于过滤 API 响应字段。 示例: - ["id", "name", "owner.username"] - "id,name,owner.username" - undefined
projectNameYes项目名称

Implementation Reference

  • The execute function implementing the tool: parses args, creates GitLab client, searches projects by name, filters fields if specified, ensures array format, returns JSON content or error.
    async execute(args: unknown, context: Context<Record<string, unknown> | undefined>) {
      const typedArgs = args as {
        projectName: string;
        fields?: string[];
      };
      
      try {
        const client = createGitlabClientFromContext(context);
        const response = await client.apiRequest('/projects', 'GET', { search: typedArgs.projectName });
        let result = response;
        
        if (typedArgs.fields) {
          result = filterResponseFields(response, typedArgs.fields);
        }
        
        if (!Array.isArray(result)) {
          result = [result];
        }
        
        return {
          content: [{ type: "text", text: JSON.stringify(result) }]
        } as ContentResult;
      } catch (error: any) {
        return {
          content: [
            {
              type: "text",
              text: `GitLab MCP 工具调用异常:${error?.message || String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema for tool input parameters: required projectName (string) and optional fields for response filtering.
    parameters: z.object({
      projectName: z.string().describe("项目名称"),
      fields: createFieldsSchema(),
    }),
  • Array of FastMCP tools including GitlabSearchProjectDetailsTool, iterated for conditional registration in registerGitLabToolsForFastMCP.
    const fastmcpTools = [
      GitlabAcceptMRTool,
      GitlabCreateMRCommentTool,
      GitlabCreateMRTool,
      GitlabGetUserTasksTool,
      GitlabRawApiTool,
      GitlabSearchProjectDetailsTool,
      GitlabSearchUserProjectsTool,
      GitlabUpdateMRTool,
    ];
  • Mapping from tool instance name to standardized GitLabToolName for filtering and identification.
    const toolNameMapping = {
      [GitlabSearchUserProjectsTool.name]: "Gitlab_Search_User_Projects_Tool",
      [GitlabGetUserTasksTool.name]: "Gitlab_Get_User_Tasks_Tool",
      [GitlabSearchProjectDetailsTool.name]: "Gitlab_Search_Project_Details_Tool",
      [GitlabCreateMRTool.name]: "Gitlab_Create_MR_Tool",
      [GitlabUpdateMRTool.name]: "Gitlab_Update_MR_Tool",
      [GitlabAcceptMRTool.name]: "Gitlab_Accept_MR_Tool",
      [GitlabCreateMRCommentTool.name]: "Gitlab_Create_MR_Comment_Tool",
      [GitlabRawApiTool.name]: "Gitlab_Raw_API_Tool",
    } as const;
  • Import of the tool for inclusion in registry.
    import { GitlabSearchProjectDetailsTool } from "./tools/GitlabSearchProjectDetailsTool";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions field filtering and efficiency improvements but lacks critical information: authentication requirements, rate limits, pagination behavior, error conditions, or what constitutes 'detailed information'. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient Chinese sentence that communicates the core functionality. It's appropriately sized without unnecessary elaboration. While front-loaded with the main purpose, it could potentially benefit from separating efficiency claims into a second sentence for better structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'detailed information' includes, how results are formatted, whether authentication is required, or how errors are handled. The agent lacks necessary context to properly understand the tool's behavior and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions field filtering ('支持字段过滤') which aligns with the 'fields' parameter in the schema. However, with 100% schema description coverage, the input schema already fully documents both parameters with examples. The description adds minimal value beyond what's already in the structured schema, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for projects by name and returns detailed information with field filtering. It specifies the verb ('搜索' - search), resource ('项目' - projects), and scope ('详细信息' - detailed information). However, it doesn't explicitly differentiate from sibling tools like 'Gitlab Search User Projects Tool' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'Gitlab Search User Projects Tool' or 'Gitlab Raw API Tool'. It mentions efficiency benefits ('提升响应效率') but doesn't specify use cases, prerequisites, or exclusions. The agent receives no direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZephyrDeng/mcp-server-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server